﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web;

namespace LynxWebLog
{
    public static class ClientUtility
    {
        public static HttpClient BlogAPIClient()
        {
            HttpClientHandler clHandler = new HttpClientHandler();
            clHandler.UseDefaultCredentials = true;
            HttpClient client = new HttpClient(clHandler);

            //client.BaseAddress = new Uri(LynxWiki.DomainModel.WikiRoot.SiteUrl);
            client.BaseAddress = new Uri((string)HttpContext.Current.Application["webApiRoot"]);

            client.DefaultRequestHeaders.Accept.Add(
                new MediaTypeWithQualityHeaderValue("application/xml"));

            return client;
        }
    }
}